import mailsystem.Connection;
import mailsystem.MailSystem;
import mailsystem.Telephone;
import mailsystem.audio.AudioPlayer;
import mailsystem.audio.AudioRecorder;
import mailsystem.gui.ConsoleInterface;
import mailsystem.gui.WindowInterface;
import mailsystem.persistance.MailsystemPersistance;
import mailsystem.persistance.database.MailsystemPersistanceDB;


/**
 * This program tests the mail system. A single phone communicates with the
 * program through System.in/System.out.
 */
public class MailSystemTester {
	public static void main(String[] args) {
		MailsystemPersistance repository = new MailsystemPersistanceDB(MAILBOX_COUNT);
		MailSystem system = new MailSystem(repository);
		
		Telephone console1 = new ConsoleInterface();
		Telephone console2 = new WindowInterface();
		
		Connection c = new Connection(system, new AudioPlayer(), new AudioRecorder());
		
		c.addPhone(console2);
		c.addPhone(console1);
		c.start();
	}

	private static final int MAILBOX_COUNT = 20;
}
